﻿
using BCCommon;
using BCCommon.Enums;
using BCData.Trading.SaleShoppingCart;
using BCDto.Trading.SaleShoppingCart;
using BCEntity.Trading.SaleShoppingCart;
using BCService.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BCService.Trading.SaleShoppingCart
{
    /// <summary>
    /// 销售购物车
    /// </summary>
    public interface ISaleShoppingCartService
    {
        #region  成员方法
        /// <summary>
        /// 是否存在此记录
        /// </summary>
        /// <param name="saleShoppingCartId">销售购物车Id</param>
        bool Exists(long saleShoppingCartId);
        /// <summary>
        /// 添加销售购物车
        /// </summary>
        /// <param name="requestDto">销售购物车信息</param>
        SaleShoppingCartDto Add(SaleShoppingCartRequestDto requestDto);
        /// <summary>
        /// 更新销售购物车
        /// </summary>
        /// <param name="putDto">销售购物车信息</param>
        SaleShoppingCartDto Update(SaleShoppingCartPutDto putDto);
        /// <summary>
        /// 修改购物车商品数量
        /// </summary>
        /// <param name="saleShoppingCartId">购物车Id</param>
        /// <param name="saleCount">商品数量</param>
        /// <returns></returns>
        bool UpdateSaleCount(long saleShoppingCartId, int saleCount);
        /// <summary>
        /// 删除销售购物车
        /// </summary>
        /// <param name="saleShoppingCartId">销售购物车Id</param>
        bool Delete(long saleShoppingCartId);
        /// <summary>
        /// 获取销售购物车
        /// </summary>
        /// <param name="saleShoppingCartId">销售购物车Id</param>
        SaleShoppingCartDto Get(long saleShoppingCartId);
        /// <summary>
        /// 获取销售购物车列表
        /// </summary>
        /// <param name="userId">用户Id</param>
        IEnumerable<SaleShoppingCartDto> GetList(long userId);
        /// <summary>
        /// 获取销售购物车数量
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <returns></returns>
        int Count(long userId);
        /// <summary>
        /// 获取销售购物车分页列表
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">销售购物车每页数据条数</param>
        PageableList<SaleShoppingCartDto> Query(long userId, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        #endregion  成员方法
        /// <summary>
        /// 合计销售商品金额
        /// </summary>
        /// <param name="ids">购物车Id</param>
        /// <returns></returns>
        decimal SumSaleGoodsAmount(List<long> ids);
    }
}